package com.oocl.service.impl;

import java.util.List;
import com.oocl.dao.FoodDao;
import com.oocl.dao.impl.FoodDaoImpl;
import com.oocl.pojo.Food;
import com.oocl.pojo.FoodType;
import com.oocl.service.FoodService;

public class FoodServiceImpl implements FoodService {

	private FoodDao foodDao;

	public FoodServiceImpl() {
		foodDao = new FoodDaoImpl();
	}

	@Override
	public void addMenu(Food menu) {
		foodDao.save(menu);
	}

	@Override
	public void deleteMenu(String id) {
		foodDao.delete(id);
	}

	@Override
	public void updateMenu(Food menu) {
		foodDao.update(menu);
	}

	@Override
	public List<Food> getFoodByMerchantId(String merchantId) {
		return foodDao.findByMerchant(merchantId);
	}

	@Override
	public List<Food> findByType(String typeId) {
		return foodDao.findByType(typeId);
	}

	@Override
	public List<FoodType> findFoodTypes() {
		return foodDao.findFoodTypes();
	}

	@Override
	public List<Food> findByTypeIdAndMerchantId(String typeId, String merchantId) {
		return foodDao.findByTypeIdAndMerchantId(typeId, merchantId);
	}

	@Override
	public List<Food> findByFuzzy(String keyWord) {
		return foodDao.findByFuzzy(keyWord);
	}

	

}
